package bscorp.appbase.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bscorp.appbase.R;
import bscorp.appbase.model.Device;

/**
 * Created by mengweima on 2018/5/7.
 */
public class DeviceAdapter extends BaseQuickAdapter<Device, BaseViewHolder> {
    public DeviceAdapter(int layoutResId, List data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Device item) {
        helper.setText(R.id.tv_name, item.getName());
        helper.setText(R.id.tv_code, "设备编号：" + item.getCode());
        helper.setText(R.id.tv_location, "设备位置：" + item.getLocation());
        helper.setText(R.id.tv_department, "使用部门：" + item.getDepartment());
        helper.addOnClickListener(R.id.ll_device_item);
        helper.addOnLongClickListener(R.id.ll_device_item);
    }
}